#ifndef X17_H
#define X17_H

#include "common.h"

// Line segment
template <AllegroVersion version>
struct x17
{
    uint32_t t;
    uint32_t k;
    
    uint32_t next;
    uint32_t parent;
    
    uint32_t un3;
#if __cplusplus >= 202002L
    COND_FIELD(version >= A_172, uint32_t, un4);
#endif
    uint32_t width;
    int32_t coords[4];
    
    uint32_t TAIL;
    operator x17<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};

#if __cplusplus < 202002L
template <> struct x17<A_172>
{
    uint32_t t;
    uint32_t k;

    uint32_t next;
    uint32_t parent;

    uint32_t un3;
    uint32_t un4;

    uint32_t width;
    int32_t coords[4];

    uint32_t TAIL;
    operator x17<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};
template <> struct x17<A_174> : x17<A_172> {};
#endif

#endif // X17_H
